<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>

<style type='text/css'>html {overflow-x: initial !important;}:root { --mermaid-theme: default; --mermaid-sequence-numbers: off; --mermaid-flowchart-curve: linear; --mermaid--gantt-left-padding: 75; --sequence-theme: simple; }


:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; --title-bar-height:20px; }
.mac-os-11 { --title-bar-height:28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px; }
thead, tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
svg { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; padding-bottom: 0px !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  .typora-export #write { break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  .is-mac table { break-inside: avoid; }
  .typora-export-show-outline .typora-export-sidebar { display: none; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.reversefootnote { font-family: ui-monospace, sans-serif; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.6; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
  .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex:2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
  .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
  .typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: ""; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: ""; }
.outline-h1 > .outline-item { padding-left: 0px; }
.outline-h2 > .outline-item { padding-left: 1em; }
.outline-h3 > .outline-item { padding-left: 2em; }
.outline-h4 > .outline-item { padding-left: 3em; }
.outline-h5 > .outline-item { padding-left: 4em; }
.outline-h6 > .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open > .outline-item > .outline-expander::before { content: ""; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open > .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: "−"; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }
.md-inline-math-container mjx-container { zoom: 0.95; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; outline: 0px; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: auto hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 10px; z-index: 3; overflow-y: hidden; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; inset: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
span.cm-underlined { text-decoration: underline; }
span.cm-strikethrough { text-decoration: line-through; }
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
.cm-tw-deleted { text-decoration: line-through; }
.cm-tw-header5 { font-weight: 700; }
.cm-tw-listitem:first-child { padding-left: 10px; }
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
.cm-tw-underline { text-decoration: underline; }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}



/* ============================================
 * ============ TYPORA lATEX THEME ============
 * ============================================
 * This project is based on the work of yfzhao20 and du33169,
   whose repositories are addressed on
   <https://github.com/yfzhao20/Typora-markdown> and
   <https://github.com/du33169/typora-theme-essay_cn>,
   many thanks to them.
 * Typora LaTeX Theme (Markdown LaTeX Theme)
   is a CSS theme mainly used as a component of Typora,
   which is designed for Chinese university students
   used in LaTeX-styled essays and reports.
 * Copyright (C) 2021 Keldos;
 * Repository Address: <https://github.com/Keldos-Li/typora-latex-theme>;
 * Licensed Under GPL v3.0, SEE <https://github.com/Keldos-Li/typora-latex-theme/blob/main/LICENSE>
 */
/* As a special exception, you may create a larger work
   that contains part or all of the Typora LaTeX Theme
   and distribute that work under terms of your choice,
   so long as that work isn't itself a CSS theme
   or can be processed into CSS theme by using some
   CSS pre-processors like SASS. Alternatively, if you
   modify or redistribute this CSS theme itself,
   you may (at your option) remove this special exception,
   which will cause the CSS theme and the resulting output files
   to be licensed under the GNU General Public License
   without this special exception.
 */
:root {
  /* == 字体设置 == */
  /* 基准字体 */
  /* 备选：Times, "Times New Roman" */
  --base-Latin-font: "Latin Modern Roman", "Latin Modern Roman 10";
  --base-Chinese-font: "宋体-简", "华文宋体", "Noto Serif CJK SC";
  --base-font-size: 12pt;
  /* 引言字体 */
  --quote-font: "Latin Modern Roman", "Latin Modern Roman 10", Times,
    "Times New Roman", "华文仿宋";
  /* 这里字体用了10pt,比正文字体稍大 */
  --quote-font-size: 11pt;
  /* 代码字体（代码中的中文会调用 ui-font） */
  --code-font: "Latin Modern Mono", "Latin Modern Mono 10", "Courier New";
  /* 侧边栏字体 */
  --ui-font: "阿里巴巴普惠体 2.0", "微软雅黑";
  /* source mode 字体 */
  /* 默认调用 code-font 和 ui-font */
  --sourceMode-font: "SF Mono", "阿里巴巴普惠体 2.0", "微软雅黑";
  /* 目录字体 */
  /* 默认调用 base-font */
  --toc-font: "";
  /* 默认调用 base-font-size */
  --toc-font-size: "";
  /* 表格字体 */
  /* 默认调用 heading-font */
  --table-title-font: "";
  /* 默认调用 base-font */
  --table-font: "";
  /* 标题字体（总设置） */
  --heading-Latin-font: var(--base-Latin-font);
  --heading-Chinese-font: "华文黑体";
  /* 标题字体分别设置 */
  /* 大标题（h1）字体 */
  --title-Chinese-font: "华文黑体";
  --title-font-size: 18pt;
  /* h2字体 */
  --h2-Chinese-font: "华文黑体";
  --h2-font-size: 16pt;
  /* h3字体 */
  --h3-Chinese-font: "华文黑体";
  --h3-font-size: 15pt;
  /* h4字体 */
  --h4-Chinese-font: "华文楷体";
  --h4-font-size: 14pt;
  /* h5字体 */
  --h5-Chinese-font: "华文仿宋";
  --h5-font-size: 13pt;
  /* h6字体 */
  --h6-Chinese-font: "华文仿宋";
  --h6-font-size: 12pt;
  /* 粗体样式设置 */
  /* 加粗风格时使用的字重；400等同于 normal，700等同于 bold，900等同于 heavy */
  --strong-weight: 900;
  /* 基础行距 */
  --base-line-height: 16pt;
  /* == 页面设置 == */
  /* 打印页边距 */
  --set-margin: 1.8cm 2cm 1.2cm 2cm !important;
  /* == 控制设置 == */
  /* 目录中是否显示一级标题 */
  --toc-show-title: none;
  /* == 颜色设置 == */
  /* 超链接颜色 */
  --link-color-light: #2E67D3;
  --link-color-dark: #8bb1f9;
}

/* ========== VERY IMPORTANT 请注意看下面的几行: ================
   如果您需要在输出PDF时隐藏超链接的颜色和下划线，请取消注释下面的代码块，即删去下面的 Ln.1 和 Ln.2
   如果您需要在输出PDF时保持超链接的显示效果，则不用更改 ============= */
/* 如要取消注释代码，请把本行删去 Ln.1

@media print {
  #write a {
    color: inherit !important;
    text-decoration: none;
  } 
}

如要取消注释代码，请把本行删去 Ln.2 */
body {
  padding: 0 !important;
  margin: 0 !important;
  line-height: var(--base-line-height);
  /* counter-reset: tableHead 0 imgHead 0; */
}

strong {
  font-weight: var(--strong-weight);
}

@media screen {
  #write {
    padding: var(--set-margin);
    /* 添加一个淡蓝色的边框 */
    /* border: 0.8px solid #AAC ; */
    /* 页边阴影 */
    box-shadow: 0 0 24px 12px #cccccc;
  }
}
@media print {
  #write {
    padding: 0 !important;
  }

  @page {
    margin: 1.8cm 2cm 1.2cm 2cm !important;
    /* 页边距 */
  }
}
/* 正文区基本属性 */
#write {
  font-family: var(--base-Latin-font), var(--base-Chinese-font), serif;
  font-size: var(--base-font-size);
  /* A4标准宽度 */
  max-width: 21cm;
  background-color: white;
  /* column-count: 2;
    column-gap: 25px;
    column-width: 8cm; 
    display: inline-block; */
  /* 这里可以试分栏的，但确实不适合实现 */
  counter-reset: h2 0 h3 0 h4 0 h5 0 h6 0;
}
#write p {
  text-align: left;
}
#write a {
  color: var(--link-color-light);
}
#write h1,
#write h2,
#write h3,
#write h4,
#write h5,
#write h6 {
  font-weight: bold;
  /* 标题字体 */
  font-family: var(--heading-Latin-font), var(--heading-Chinese-font), sans-serif;
  page-break-after: avoid !important;
}
#write h1 {
  font-family: var(--heading-Latin-font), var(--title-Chinese-font), sans-serif;
  text-align: center;
  column-span: all;
  font-size: var(--title-font-size);
}
#write h2 {
  font-family: var(--heading-Latin-font), var(--h2-Chinese-font), sans-serif;
  font-size: var(--h2-font-size);
}
#write h3 {
  font-family: var(--heading-Latin-font), var(--h3-Chinese-font), sans-serif;
  font-size: var(--h3-font-size);
  line-height: var(--h3-font-size);
}
#write h4 {
  font-family: var(--heading-Latin-font), var(--h4-Chinese-font), sans-serif;
  font-size: var(--h4-font-size);
  line-height: var(--h4-font-size);
}
#write h5 {
  font-family: var(--heading-Latin-font), var(--h5-Chinese-font), sans-serif;
  font-size: var(--h5-font-size);
  line-height: var(--h5-font-size);
}
#write h6 {
  font-family: var(--heading-Latin-font), var(--h6-Chinese-font), sans-serif;
  font-size: var(--h6-font-size);
  /* 没有写错，为了避免行距太小才这么写 */
  line-height: var(--h5-font-size);
}
#write table {
  /* 三线表第一条线宽度 */
  border-top: 1.2pt solid;
  /* 三线表第二条线宽度 */
  border-bottom: 1.2pt solid;
  font-family: var(--table-font), var(--base-Latin-font), var(--base-Chinese-font), serif;
  /* font-size: var(--base-font-size); */
  text-align: center;
  page-break-inside: avoid;
  border-spacing: 6px;
  /* 自动布局表格宽度，如果有时内容太紧建议直接加空格吧，我自己看不惯和页面等宽的大表格 */
  width: auto;
  /* 使表格默认居中；虽然这个代码不好，但好像没别的实现办法 */
  margin: 0 auto;
}
#write table td {
  padding: 2px;
}
#write table tr {
  padding: 2px;
}
#write th {
  padding: 0px 6px;
}
#write thead {
  /* 表格标题（首行）样式 */
  /* 三线表表头的线 */
  border-bottom: 0.5pt solid;
  font-family: var(--table-title-font), var(--heading-Latin-font), var(--heading-Chinese-font), serif !important;
  /* font-size: var(--base-font-size); */
  font-weight: var(--strong-weight);
}
#write .CodeMirror-wrap {
  padding: 10px;
}
#write .CodeMirror-code pre {
  font-family: var(--code-font), var(--ui-font), monospace;
}
#write h1 {
  counter-reset: h2;
}
#write h2 {
  counter-reset: h3;
}
#write h3 {
  counter-reset: h4;
}
#write h4 {
  counter-reset: h5;
}
#write h5 {
  counter-reset: h6;
}

/*
#write figure:after{
  counter-increment: tableHead;
  content: "表" counter(tableHead) " ";
  text-align:center;
  width:100%;
  display:inline-block;
}*/
/* 图片，导出PDF时暂时无法显示 */
/*
#write .md-image:after{
  counter-increment: imgHead;
  content: "图" counter(imgHead) " ";
  text-align:center;
  width:100%;
  display:inline-block;
}
*/
/* basic 样式采用一般的引言，具有左边框、左缩进 */
blockquote {
  font-style: normal;
  font-family: var(--quote-font), var(--base-Latin-font), var(--base-Chinese-font), -apple-system, serif;
  font-size: var(--quote-font-size);
  /* 文字离左边框的距离 */
  padding-left: 16px;
  padding-right: 20pt;
  /* 左边框离页面边的距离 */
  margin-left: 20px;
}

hr {
  border-top: solid 0.7px #eee;
}

img {
  /* 避免图片在导出时被断开 */
  page-break-inside: avoid;
}

/* ============ 多级列表样式 ============ */
ul {
  /* 无序列表第一级：实心圆点 */
  list-style: disc;
}
ul ul {
  /*list-style: circle;*/
  /* 请勿删除“–”后的空格, 他们对缩进有一定影响, 下同 */
  list-style: "–　 ";
  /*left: -0.8rem;*/
}
ul ul ul {
  /* 无序列表第三极：小圈 */
  list-style: "◦　";
  left: 0.1rem;
}

ol {
  /* 有序列表第一级：数字 */
  list-style: decimal;
}
ol ol {
  counter-reset: liist;
  list-style: none;
}
ol ol li {
  counter-increment: liist;
  position: relative;
}
ol ol li::before {
  /* 有序列表第二级：括号加小写字母 */
  content: "(" counter(liist,decimal) ")　　";
  position: absolute;
  margin-right: 2rem;
  left: -2.4rem;
}
ol ol ol {
  counter-reset: liiist;
  list-style: none;
  margin: 0;
}
ol ol ol li {
  counter-increment: liiist;
  position: relative;
}
ol ol ol li::before {
  /* 有序列表第三级：小写罗马数字 */
  content: counter(liiist,lower-roman) ".　　";
  align-self: flex-end;
  position: absolute;
  left: -3rem;
  /* -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;*/
  /* 为了让项目编号是重新用句点对齐而不是左对齐 */
  width: 4.2rem;
  text-align: right;
}

li {
  position: relative;
}

/* ============ 多级列表样式END ============ */
/* 行内代码 */
code {
  font-family: var(--code-font), var(--ui-font), monospace;
}

h1 code, h2 code, h3 code, h4 code, h5 code, h6 code,
p code,
li code {
  color: #3c70c6;
  background-color: #fefefe;
  /* 阴影 */
  box-shadow: 0 0 1px 1px #c8d3df;
  font-family: var(--code-font), var(--ui-font), monospace;
  box-sizing: border-box;
  border-right: 0px;
  margin: 0 2px 0 2px;
  padding: 0 2px 0 2px;
  /* 圆角 */
  border-radius: 2px 2px 2px 2px;
}

/* typora 编写模式 */
#typora-source {
  font-family: var(--sourceMode-font), var(--code-font), var(--ui-font), monospace;
  line-height: 2rem;
}

#write h2:before {
  counter-increment: h2;
  content: counter(h2);
  margin-right: 2rem;
}

#write h3:before, h3.md-focus.md-heading:before {
  counter-increment: h3;
  content: counter(h2) "." counter(h3);
  margin-right: 2rem;
}

#write h4:before, h4.md-focus.md-heading:before {
  counter-increment: h4;
  content: counter(h2) "." counter(h3) "." counter(h4);
  margin-right: 2rem;
}

#write h5:before, h5.md-focus.md-heading:before {
  counter-increment: h5;
  content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5);
  margin-right: 2rem;
}

#write h6:before, h6.md-focus.md-heading:before {
  counter-increment: h6;
  content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6);
  margin-right: 2rem;
}

.footnotes-area .footnote-line {
  color: var(--text-color);
  font-size: var(--base-font-size);
}
.footnotes-area hr {
  border: 0;
  color: #00000000;
}

/* 目录 */
.md-toc-content {
  margin-left: 2em;
  /* 修复缺失上级标题时无法递增 */
  counter-reset: toc-h2 toc-h3 toc-h4;
  page-break-after: always;
}

.md-toc-inner {
  margin-left: 0 !important;
  color: var(--text-color) !important;
}

.md-toc-item {
  color: var(--text-color) !important;
}

/* 目录标题内容属性 */
.md-toc-h2,
.md-toc-h3,
.md-toc-h4,
.md-toc-h5,
.md-toc-h6 {
  font-size: var(--toc-font-size);
  font-family: var(--toc-font), var(--base-Latin-font), var(--base-Chinese-font), serif;
}

.md-toc-h2 {
  font-weight: var(--strong-weight);
}

/* 目录标题前 */
.md-toc-content .md-toc-h1 {
  display: var(--toc-show-title);
  counter-reset: toc-h2;
}
.md-toc-content .md-toc-h2 {
  counter-reset: toc-h3;
}
.md-toc-content .md-toc-h3 {
  counter-reset: toc-h4;
}
.md-toc-content .md-toc-h4 {
  counter-reset: toc-h5;
}
.md-toc-content .md-toc-h5 {
  counter-reset: toc-h6;
}
.md-toc-content .md-toc-h2:before {
  counter-increment: toc-h2;
  content: counter(toc-h2);
  margin-right: 1rem;
  font-weight: var(--strong-weight);
}
.md-toc-content .md-toc-h3:before {
  counter-increment: toc-h3;
  content: counter(toc-h2) "." counter(toc-h3);
  margin-left: 1.5rem;
  margin-right: 0.5rem;
}
.md-toc-content .md-toc-h4:before {
  counter-increment: toc-h4;
  content: counter(toc-h2) "." counter(toc-h3) "." counter(toc-h4);
  margin-left: 3.5rem;
  margin-right: 0.5rem;
}
.md-toc-content .md-toc-h5:before {
  counter-increment: toc-h5;
  content: counter(toc-h2) "." counter(toc-h3) "." counter(toc-h4) "." counter(toc-h5);
  margin-left: 5.5rem;
  margin-right: 0.5rem;
}
.md-toc-content .md-toc-h6:before {
  counter-increment: toc-h6;
  content: counter(toc-h2) "." counter(toc-h3) "." counter(toc-h4) "." counter(toc-h5) "." counter(toc-h6);
  margin-left: 7.5rem;
  margin-right: 0.5rem;
}

/* 侧边大纲标题 */
.sidebar-content .outline-h1 {
  counter-reset: outline-h2;
}
.sidebar-content .outline-h2 {
  counter-reset: outline-h3;
}
.sidebar-content .outline-h2 .outline-label:before {
  counter-increment: outline-h2;
  content: counter(outline-h2) " ";
}
.sidebar-content .outline-h3 {
  counter-reset: outline-h4;
}
.sidebar-content .outline-h3 .outline-label:before {
  counter-increment: outline-h3;
  content: counter(outline-h2) "." counter(outline-h3) "  ";
}
.sidebar-content .outline-h4 {
  counter-reset: outline-h5;
}
.sidebar-content .outline-h4 .outline-label:before {
  counter-increment: outline-h4;
  content: counter(outline-h2) "." counter(outline-h3) "." counter(outline-h4) "  ";
}
.sidebar-content .outline-h5 {
  counter-reset: outline-h6;
}
.sidebar-content .outline-h5 .outline-label:before {
  counter-increment: outline-h5;
  content: counter(outline-h2) "." counter(outline-h3) "." counter(outline-h4) "." counter(outline-h5) "  ";
}

.sidebar-content {
  /* 侧边栏的字体修改 */
  font-family: var(--ui-font);
  list-style: none;
}

/* 元数据（如 YAML front matter）的背景框 */
pre.md-meta-block {
  background: #cccccc;
  padding: 1.4em;
  font-family: var(--code-font), var(--ui-font), monospace;
}

#write > h3.md-focus:before,
#write > h4.md-focus:before,
#write > h5.md-focus:before,
#write > h6.md-focus:before,
h3.md-focus:before,
h4.md-focus:before,
h5.md-focus:before,
h6.md-focus:before {
  color: inherit;
  border: inherit;
  border-radius: inherit;
  position: inherit;
  left: initial;
  float: none;
  top: initial;
  font-size: inherit;
  padding-left: inherit;
  padding-right: inherit;
  vertical-align: inherit;
  font-weight: inherit;
  line-height: inherit;
}



</style><title>11</title>
</head>
<body class='typora-export os-windows'><div class='typora-export-content'>
<div id='write'  class=''><ul><li><a href='https://github.com/3293172751'><span>author</span></a></li></ul><h1 id='第11节-汇编语言程序'><span>第11节 汇编语言程序</span></h1><ul><li><a href='../README.md'><span>回到目录</span></a></li><li><a href='../../README.md'><span>回到项目首页</span></a></li><li><a href='10.md'><span>上一节</span></a></li></ul><blockquote><p><span>❤️💕💕汇编语言目前仍在发挥着不可替代的作用，在效率上无可替代，在底层，学习linux内核，计算机外围设备和驱动，都离不开汇编。Myblog:</span><a href='http://nsddd.top/'><span>http://nsddd.top</span></a></p></blockquote><hr /><div class='md-toc' mdtype='toc'><p class="md-toc-content" role="list"><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n4"><a class="md-toc-inner" href="#第11节-汇编语言程序">第11节 汇编语言程序</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n16"><a class="md-toc-inner" href="#汇编程序编译">汇编程序编译</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n95"><a class="md-toc-inner" href="#汇编语言的结构">汇编语言的结构</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n133"><a class="md-toc-inner" href="#如何写出一个程序">如何写出一个程序</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n204"><a class="md-toc-inner" href="#程序中可能的错误">程序中可能的错误</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n129"><a class="md-toc-inner" href="#从源程序到程序运行">从源程序到程序运行</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n263"><a class="md-toc-inner" href="#验证程序结果">验证程序结果</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n290"><a class="md-toc-inner" href="#debug转载程序">debug转载程序</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n353"><a class="md-toc-inner" href="#分析">分析</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n372"><a class="md-toc-inner" href="#和的约定">[…]和(…)的约定</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n386"><a class="md-toc-inner" href="#再约定idata表示常量">再约定<code>idata</code>表示常量</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n19"><a class="md-toc-inner" href="#end-链接">END 链接</a></span></p></div><h2 id='汇编程序编译'><span>汇编程序编译</span></h2><ul><li><span>汇编程序：包含汇编指令和</span><strong><span>伪指令</span></strong><span>的文本</span></li></ul><div class="md-diagram-panel md-fences-adv-panel"><svg id="mermaidChart35" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" role="img" aria-labelledby="chart-title-mermaidChart35 chart-desc-mermaidChart35" height="84.00347137451172" style="max-width: 572.0167007446289px;" viewBox="0 0 572.0167007446289 84.00347137451172"><title id="chart-title-mermaidChart35"></title><desc id="chart-desc-mermaidChart35"></desc><style>#mermaidChart35 {font-family:sans-serif;font-size:16px;fill:#333;}#mermaidChart35 .error-icon{fill:#552222;}#mermaidChart35 .error-text{fill:#552222;stroke:#552222;}#mermaidChart35 .edge-thickness-normal{stroke-width:2px;}#mermaidChart35 .edge-thickness-thick{stroke-width:3.5px;}#mermaidChart35 .edge-pattern-solid{stroke-dasharray:0;}#mermaidChart35 .edge-pattern-dashed{stroke-dasharray:3;}#mermaidChart35 .edge-pattern-dotted{stroke-dasharray:2;}#mermaidChart35 .marker{fill:#333333;stroke:#333333;}#mermaidChart35 .marker.cross{stroke:#333333;}#mermaidChart35 svg{font-family:sans-serif;font-size:16px;}#mermaidChart35 .label{font-family:sans-serif;color:#333;}#mermaidChart35 .cluster-label text{fill:#333;}#mermaidChart35 .cluster-label span{color:#333;}#mermaidChart35 .label text,#mermaidChart35 span{fill:#333;color:#333;}#mermaidChart35 .node rect,#mermaidChart35 .node circle,#mermaidChart35 .node ellipse,#mermaidChart35 .node polygon,#mermaidChart35 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaidChart35 .node .label{text-align:center;}#mermaidChart35 .node.clickable{cursor:pointer;}#mermaidChart35 .arrowheadPath{fill:#333333;}#mermaidChart35 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaidChart35 .flowchart-link{stroke:#333333;fill:none;}#mermaidChart35 .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaidChart35 .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaidChart35 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaidChart35 .cluster text{fill:#333;}#mermaidChart35 .cluster span{color:#333;}#mermaidChart35 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaidChart35 :root{--mermaid-font-family:sans-serif;}#mermaidChart35 :root{--mermaid-alt-font-family:sans-serif;}</style><g transform="translate(0, 0)"><g class="output"><g class="clusters"></g><g class="edgePaths"><g class="edgePath LS-程序员 LE-编译指令" id="L-程序员-编译指令" style="opacity: 1;"><path class="path" d="M76.00347137451172,42.00173568725586L101.00347137451172,42.00173568725586L126.00347137451172,42.00173568725586" marker-end="url(#arrowhead604)" style="fill:none"></path><defs><marker id="arrowhead604" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath LS-编译指令 LE-编译器" id="L-编译指令-编译器" style="opacity: 1;"><path class="path" d="M210.00628662109375,42.00173568725586L235.00628662109375,42.00173568725586L260.00628662109375,42.00173568725586" marker-end="url(#arrowhead605)" style="fill:none"></path><defs><marker id="arrowhead605" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath LS-编译器 LE-机器码" id="L-编译器-机器码" style="opacity: 1;"><path class="path" d="M328.00975799560547,42.00173568725586L353.00975799560547,42.00173568725586L378.00975799560547,42.00173568725586" marker-end="url(#arrowhead606)" style="fill:none"></path><defs><marker id="arrowhead606" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath LS-机器码 LE-计算机" id="L-机器码-计算机" style="opacity: 1;"><path class="path" d="M446.0132293701172,42.00173568725586L471.0132293701172,42.00173568725586L496.0132293701172,42.00173568725586" marker-end="url(#arrowhead607)" style="fill:none"></path><defs><marker id="arrowhead607" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g></g><g class="edgeLabels"><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><rect rx="0" ry="0" width="0" height="0"></rect><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span id="L-L-程序员-编译指令" class="edgeLabel L-LS-程序员' L-LE-编译指令" style=""></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><rect rx="0" ry="0" width="0" height="0"></rect><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span id="L-L-编译指令-编译器" class="edgeLabel L-LS-编译指令' L-LE-编译器" style=""></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><rect rx="0" ry="0" width="0" height="0"></rect><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span id="L-L-编译器-机器码" class="edgeLabel L-LS-编译器' L-LE-机器码" style=""></span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><rect rx="0" ry="0" width="0" height="0"></rect><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span id="L-L-机器码-计算机" class="edgeLabel L-LS-机器码' L-LE-计算机" style=""></span></div></foreignObject></g></g></g><g class="nodes"><g class="node default" id="flowchart-编译指令-546" transform="translate(168.00487899780273,42.00173568725586)" style="opacity: 1;"><rect rx="5" ry="5" x="-42.001407623291016" y="-20.666232109069824" width="84.00281524658203" height="41.33246421813965" class="label-container"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-32.001407623291016,-10.666232109069824)"><foreignObject width="64.00281524658203" height="21.33246421813965"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">编译指令</div></foreignObject></g></g></g><g class="node default" id="flowchart-机器码-547" transform="translate(412.0114936828613,42.00173568725586)" style="opacity: 1;"><rect rx="5" ry="5" x="-34.00173568725586" y="-20.666232109069824" width="68.00347137451172" height="41.33246421813965" class="label-container"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-24.00173568725586,-10.666232109069824)"><foreignObject width="48.00347137451172" height="21.33246421813965"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">机器码</div></foreignObject></g></g></g><g class="node default" id="flowchart-程序员-548" transform="translate(42.00173568725586,42.00173568725586)" style="opacity: 1;"><circle x="-34.00173568725586" y="-20.666232109069824" r="34.00173568725586" class="label-container"></circle><g class="label" transform="translate(0,0)"><g transform="translate(-24.00173568725586,-10.666232109069824)"><foreignObject width="48.00347137451172" height="21.33246421813965"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">程序员</div></foreignObject></g></g></g><g class="node default" id="flowchart-编译器-549" transform="translate(294.0080223083496,42.00173568725586)" style="opacity: 1;"><circle x="-34.00173568725586" y="-20.666232109069824" r="34.00173568725586" class="label-container"></circle><g class="label" transform="translate(0,0)"><g transform="translate(-24.00173568725586,-10.666232109069824)"><foreignObject width="48.00347137451172" height="21.33246421813965"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">编译器</div></foreignObject></g></g></g><g class="node default" id="flowchart-计算机-550" transform="translate(530.014965057373,42.00173568725586)" style="opacity: 1;"><circle x="-34.00173568725586" y="-20.666232109069824" r="34.00173568725586" class="label-container"></circle><g class="label" transform="translate(0,0)"><g transform="translate(-24.00173568725586,-10.666232109069824)"><foreignObject width="48.00347137451172" height="21.33246421813965"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">计算机</div></foreignObject></g></g></g></g></g></g></svg></div><p><strong><span>汇编指令：对应机器码的指令，可以被编译为机器指令，最终被CPU执行。</span></strong></p><p><strong><span>伪指令：没有对应的机器码的指令，最终不被CPU所执行。</span></strong></p><ul><li><span>伪指令是由编译器来执行的指令，编译器根据伪指令进行相关的编译工作</span></li></ul><p><img src="https://sm.nsddd.top/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTQzNzUyMQ==,size_16,color_FFFFFF,t_70.png?mail:3293172751@qq.com" referrerpolicy="no-referrer" alt="伪指令"></p><p>&nbsp;</p><p><span>在上面这个程序中，一直到assume都是伪指令。</span></p><p>&nbsp;</p><p><img src="https://sm.nsddd.top/image-20220804142953205.png?mail:3293172751@qq.com" referrerpolicy="no-referrer" alt="image-20220804142953205"></p><p><span>这里我们更清楚地说明一下</span></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.6651px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>2</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">codesg segment</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">codesg ends &nbsp;  ;段的结束</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 43px;"></div><div class="CodeMirror-gutters" style="height: 43px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre><ul><li><span>（codesg是段的名字）</span><strong><span>是一对成对使用的伪指令，也是写汇编程序时必须要用到的一对伪指令。因为一个有意义的汇编程序中至少要有一个段。</span></strong></li></ul><ul><li><span>segment和ends的作用是定义一个段，segment说明一个段开始，ends说明一个段结束。</span><strong><span>注意区分end和ends</span></strong></li></ul><ul><li><span>end也是一个伪指令，是一个汇编程序的结束标记。</span></li><li><span>而ends标志着一个段的结束，可以把ends理解成”end segment“</span>
</li></ul><p>&nbsp;</p><h2 id='汇编语言的结构'><span>汇编语言的结构</span></h2><blockquote><p><span>之前在debug中直接写入指令编写汇编程序，就相当于是一个交互式，不需要伪指令</span></p><ul><li><span>适用于功能简单、短小精悍的程序</span></li><li><span>只需要包含汇编指令</span></li></ul></blockquote><p><strong><span>对于单独编写的源文件再编译为可执行文件的程序</span></strong></p><p>&nbsp;</p><h2 id='如何写出一个程序'><span>如何写出一个程序</span></h2><blockquote><p><span>求汇编编写 2</span><sup><span>3</span></sup></p></blockquote><ol><li><p><span>定义一个段</span></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang="assembly"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="assembly"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.6653px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>2</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">segment</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">ends</span> &nbsp; <span class="cm-comment">;段的开始和结束 &nbsp;</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 43px;"></div><div class="CodeMirror-gutters" style="height: 43px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre></li><li><p><span>实现处理任务</span></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang="assembly"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="assembly"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.6653px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>5</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">segment</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,2<span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;2放入ax寄存器</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;2 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;4 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">ends</span> &nbsp; <span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;段的开始和结束 &nbsp;</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 109px;"></div><div class="CodeMirror-gutters" style="height: 109px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre></li><li><p><span>指出程序在哪结束</span></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang="assembly"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="assembly"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.665px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>6</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">segment</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,2<span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;2放入ax寄存器</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;2 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;4 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">ends</span> &nbsp; <span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;段的开始和结束 &nbsp;</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 131px;"></div><div class="CodeMirror-gutters" style="height: 131px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre></li><li><p><span>段和段寄存器关联</span></p><ol><li><span>我们用到</span><code>abc</code><span>段，和代码段关联起来</span></li></ol><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang="assembly"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="assembly"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.665px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>7</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">assume</span> <span class="cm-tag">cs:</span><span class="cm-keyword">abc</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">segment</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,2<span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;2放入ax寄存器</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;2 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;4 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 18px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">ends</span> &nbsp; <span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;段的开始和结束 &nbsp;</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 152px;"></div><div class="CodeMirror-gutters" style="height: 152px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre></li><li><p><span>加上程序返回的代码</span></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang="assembly"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="assembly"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.665px; left: 47.9926px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 34px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>10</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -33.9952px; width: 34px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 25px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">assume</span> <span class="cm-tag">cs:</span><span class="cm-keyword">abc</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">segment</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,2<span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;2放入ax寄存器</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;2 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;4 + 2</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre></div><div style="position: relative;" class=""><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,4c00h</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">int</span> <span class="cm-keyword">21h</span><span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;这个是一个套路，我们要记住</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">9</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">ends</span> &nbsp; <span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;段的开始和结束 &nbsp;</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 25px;">10</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 218px;"></div><div class="CodeMirror-gutters" style="height: 218px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 33px;"></div></div></div></div></pre></li></ol><blockquote><p><strong><span>我们后期在处理复杂任务的时候，无非就是实现处理任务中加入或者是处理多个复杂段。</span></strong></p></blockquote><p>&nbsp;</p><h2 id='程序中可能的错误'><span>程序中可能的错误</span></h2><blockquote><p><span>我们要避免语法错误，更要注意逻辑错误</span></p></blockquote><ul><li><span>语法错误 ： 编译中会指明</span></li><li><span>逻辑错误 ： 程序在编译时不表现出来，但是运行时候出现错误</span></li></ul><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang="assembly"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="assembly"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.665px; left: 47.9926px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 34px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>10</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -33.9952px; width: 34px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 25px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">assume</span> <span class="cm-tag">cs:</span><span class="cm-keyword">abc</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">segment</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,2<span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">ax</span><span class="cm-tab" role="presentation" cm-text="	">   </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">add</span> <span class="cm-variable">ax</span>,<span class="cm-variable">bx</span><span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">;不会报错</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">mov</span> <span class="cm-variable">ax</span>,4c10h <span class="cm-comment">;写错了不会报错但是后面有问题</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">int</span> <span class="cm-keyword">21h</span><span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;这个是一个套路，我们要记住</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 25px;">9</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">abc</span> <span class="cm-keyword">ends</span> &nbsp; <span class="cm-tab" role="presentation" cm-text="	"> </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">;段的开始和结束 &nbsp;</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -33.9952px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 25px;">10</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">end</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 218px;"></div><div class="CodeMirror-gutters" style="height: 218px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 33px;"></div></div></div></div></pre><p>&nbsp;</p><h2 id='从源程序到程序运行'><span>从源程序到程序运行</span></h2><p><img src="assets/image-20220804150151392.png" referrerpolicy="no-referrer" alt="image-20220804150151392"></p><p><strong><span>我们在MASM文件对应目录下创建</span><code>code</code><span>文件夹，新建文件</span><code>add.asm</code><span>，写入上面的程序，编译</span></strong></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.6651px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>1</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">masm.exe code\add.asm</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 21px;"></div><div class="CodeMirror-gutters" style="height: 21px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre><ul><li><span>目标文件</span><code>*.OBJ</code><span>是我们对一个源程序进行编译要得到的最终结果</span></li><li><span>列表文件</span><code>*.LST</code><span>是编译器将源文件白你以为目标文件过程中产生的中间结果</span></li><li><span>最后两行告诉我们这个程序</span><strong><span>没有警告错误</span></strong><span>和</span><strong><span>必须要改正的错误</span></strong></li></ul><p><img src="assets/image-20220804150558263.png" alt="image-20220804150558263" style="zoom:30%;" /></p><hr /><h2 id='验证程序结果'><span>验证程序结果</span></h2><blockquote><p><span>我们只是编译了程序，但是并没有显示程序的执行结果，这个时候我们可以在</span><code>debug</code><span>中调试。</span></p></blockquote><ol><li><span>使用</span><code>masm</code><span>编译，产生目标文件</span></li><li><span>使用</span><code>link</code><span>命令，把目标文件转为成可执行文件</span></li><li><span>执行可执行文件</span></li></ol><p><img src="assets/image-20220804151707345.png" alt="image-20220804151707345" style="zoom:50%;" /></p><p>&nbsp;</p><h2 id='debug转载程序'><span>debug转载程序</span></h2><ol><li><p><span>转载</span></p><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 18.6652px; left: 40.9939px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 27px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>1</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -26.9965px; width: 27px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -26.9965px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 18px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">debug add.exe</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 21px;"></div><div class="CodeMirror-gutters" style="height: 21px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 26px;"></div></div></div></div></pre></li><li><p><span>程序被转在哪里 </span><code>-r</code></p><ol><li><span>DS=？075A</span></li><li><span>CS=？076A</span></li></ol></li><li><p><span>查看代码段</span><code>-u</code></p></li></ol><p><span>	</span><img src="assets/image-20220804152401507.png" alt="image-20220804152401507" style="zoom:50%;" /></p><p>&nbsp;</p><h2 id='分析'><span>分析</span></h2><blockquote><p><span>程序加载中，DS放</span><strong><span>程序所在区的段地址</span></strong><span>，偏移地址为</span><code>0</code><span>,则内存区地址为：</span><code>DS:0</code></p><p><span>这个内存区的前</span><code>256</code><span>个字节存放</span><code>PSP</code><span>,DOS用来和程序进行通信</span></p><p><span>从</span><code>256</code><span>字节后空间存放的是</span><strong><span>程序</span></strong><span>，</span><code>CS</code><span>的值为</span><code>DS+10H</code></p><p><span>程序加载后，CX存放的是代码的长度</span></p></blockquote><p>&nbsp;</p><p><code>-t</code><span>单步执行</span></p><p><img src="assets/image-20220804153056351.png" alt="image-20220804153056351" style="zoom:50%;" /></p><p>&nbsp;</p><h2 id='和的约定'><span>[…]和(…)的约定</span></h2><ul><li><span>[…] –   (汇编语言语法要求)表示一个内存地址</span></li><li><span>(…) –  (为学习方便做出的约定)表示一个内存单元或者一个寄存器中的内容</span></li></ul><figure><table><thead><tr><th><strong><span>指令</span></strong></th><th><strong><span>段地址</span></strong></th><th><strong><span>偏移地址</span></strong></th><th><strong><span>操作单位</span></strong></th></tr></thead><tbody><tr><td><strong><span>mov ax, </span><span>[</span><span>0</span><span>]</span></strong></td><td><span>在DS中</span></td><td><span>在</span><span>[</span><span>0</span><span>]</span><span>中</span></td><td><span>字</span></td></tr><tr><td><strong><span>mov al, </span><span>[</span><span>0</span><span>]</span></strong></td><td><span>在DS中</span></td><td><span>在</span><span>[</span><span>0</span><span>]</span><span>中</span></td><td><span>字节</span></td></tr><tr><td><strong><span>mov ax, </span><span>[</span><span>bx</span><span>]</span></strong></td><td><span>在DS中</span></td><td><span>在</span><span>[</span><span>bx</span><span>]</span><span>中</span></td><td><span>字</span></td></tr><tr><td><strong><span>mov al, </span><span>[</span><span>bx</span><span>]</span></strong></td><td><span>在DS中</span></td><td><span>在</span><span>[</span><span>bx</span><span>]</span><span>中</span></td><td><span>字节</span></td></tr></tbody></table></figure><h3 id='再约定idata表示常量'><span>再约定</span><code>idata</code><span>表示常量</span></h3><p>&nbsp;</p><h2 id='end-链接'><span>END 链接</span></h2><ul><li><a href='../README.md'><span>回到目录</span></a></li><li><a href='10.md'><span>上一节</span></a></li><li><a href='12.md'><span>下一节</span></a></li></ul><hr /><ul><li><a href='https://github.com/3293172751/Block_Chain/blob/master/Git/git-contributor.md'><span>参与贡献❤️💕💕</span></a></li></ul></div></div>
</body>
</html>